<template>
  <div class="main">
    <img mode="widthFix" :src="url" :key="index" v-for="(url, index) in urlArr">
  </div>
</template>

<script>
import {get} from '@/utils'

export default {
  data () {
    return {
      topicDetail: {},
      urlArr: []
    }
  },
  async mounted () {
    this.urlArr = []
    const {id} = this.$root.$mp.query
    const res = await get('/weapp/topicDetail', {
      id
    })
    this.topicDetail = res.topicDetail
    let url = res.topicDetail.content.split('"')
    for (let i = 1; i < url.length; i = i + 2) {
      this.urlArr.push(url[i])
    }
  }
}
</script>

<style lang="less" scoped>
.main{
  img{
    width: 100%;
  }
}
</style>
